package com.example.backend.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Order {
    Integer id;
    Integer userid;
    Double price;
    Boolean paid;

    List<OrderItem> items;

    public Order(Integer id, Integer userid, Double price, Integer paid) {
        this.id = id;
        this.userid = userid;
        this.price = price;
        items = new ArrayList<>();
        this.paid = paid == 1;
    }
}
